<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!--bootstrap插件-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link href="/static/plugin/bootstrap/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="/static/plugin/jo/joUI.css" rel="stylesheet"/>
    <!--字体插件-->
    <link href="/static/plugin/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="/static/plugin/layui-2.4.3/css/layui.css" rel="stylesheet"/>
    <!--ztree-->
    <link href="/static/plugin/zTree/css/metroStyle/metroStyle.css" rel="stylesheet"/>
    <!--common-->
    <link href="/static/css/common.css" rel="stylesheet"/>
    <title>企业监测样品表单</title>
</head>
<body>
<div class="container-fluid">
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <!--按钮栏-->
            <div class="form-group button-bar button-bar">
                <!--按钮占位符.加载到的按钮会渲染到占位符里面-->
                <span class="young-button-placeholder" navigateId="QYJC_FORM_BUTTON"></span>

               <!-- <button type="button" isShow="joForm.isAdd" class="btn btn-primary" onclick="joForm.save()">
                    <i class="fa fa-plus-circle" aria-hidden="true"></i>&nbsp;新增
                </button>
                <button type="button" isShow="!joForm.isAdd" class="btn btn-info" onclick="joForm.update()">
                    <i class="fa fa-pencil-square" aria-hidden="true"></i>&nbsp;修改
                </button>
                <button type="button" isShow="!joForm.isAdd" class="btn btn-danger" onclick="joForm.del()">
                    <i class="fa fa-trash" aria-hidden="true"></i>&nbsp;删除
                </button>-->
            </div>
            <!--按钮栏-->
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <form id="pageForm" name="pageForm" action="" method="post">


                <div class="young-form-item col-md-6" id="pro">
                    <div class="young-form-label">省</div>
                    <div class="young-form-tips"></div>
                    <div class="young-form-input-block">
                        <select name="province" id="provinceCode" class="joSelect form-control" data='' firstItem='{"id":"","name":""}'
                                dataurl="" keyfield="id" valuefield="name"></select>
                    </div>
                </div>
                <div class="young-form-item col-md-6" id="city">
                    <div class="young-form-label">市</div>
                    <div class="young-form-tips"></div>
                    <div class="young-form-input-block">
                        <select   name="city" id="cityCode" class="joSelect form-control"   data='' firstItem='{"id":"","name":""}' dataurl="" keyfield="id" valuefield="name"></select>
                    </div>
                </div>
                <div class="young-form-item col-md-6" id="cou">
                    <div class="young-form-label">县</div>
                    <div class="young-form-tips"></div>
                    <div class="young-form-input-block">
                        <select  name="county" id="countyCode" class="joSelect form-control" data='' firstItem='{"id":"","name":""}' dataurl="" keyfield="id" valuefield="name"></select>
                    </div>
                </div>
                <div class="young-form-item col-md-6 must" id="lan">
                    <div class="young-form-label">企业</div>
                    <div class="young-form-tips"></div>
                    <div class="young-form-input-block">
                        <!--  <input type="text"   name="enterpriseId" value="" class="form-control "  ErrNumber="企业ID需填写数字类型" />-->
                       <div id="qiye">
                           <select  name="enterpriseId" id="enterpriseId" class="joSelect form-control" ErrEmpty="企业不允许为空" data=''
                                 firstItem='{"id":"","enterprisename":""}' dataurl="" keyfield="id" valuefield="enterprisename">
                            </select>

                       </div>

                    </div>
                </div>

                <div class="young-form-item col-md-6 ">
                    <div class="young-form-label">样点编码</div>
                    <div class="young-form-tips"></div>
                    <div class="young-form-input-block">
                        <input type="text" id="pointCode"  name="pointCode" value="" class="form-control readonly-edit"   />
                    </div>
                </div>
                <div class="young-form-item col-md-6 ">
                    <div class="young-form-label">样品编码</div>
                    <div class="young-form-tips"></div>
                    <div class="young-form-input-block">
                        <input type="text"   name="sampleNumber" value="" class="form-control "   />
                    </div>
                </div>
                <div class="young-form-item col-md-6 ">
                    <div class="young-form-label">采样类型</div>
                    <div class="young-form-tips"></div>
                    <div class="young-form-input-block">
                        <!--<input type="text"   name="sampleType" value="" class="form-control "   />-->
                        <select  name="sampleType" value="" class="form-control">
                            <option value="表层">表层</option>
                            <option value="深层">深层</option>
                        </select>
                    </div>
                </div>
                <div class="young-form-item col-md-6 ">
                    <div class="young-form-label">采样时间</div>
                    <div class="young-form-tips"></div>
                    <div class="young-form-input-block">
                        <input type="text" id="sampleTime" value="" name="sampleTime" class="form-control "   />
                    </div>
                </div>
                <div class="young-form-item col-md-6 ">
                    <div class="young-form-label">备注</div>
                    <div class="young-form-tips"></div>
                    <div class="young-form-input-block">
                        <input type="text"   name="sampleRemarks" value="" class="form-control "   />
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<!--配置信息-->
<script src="/static/js/config.js"></script>
<!--jquery-->
<script src="/static/plugin/jquery/jquery-3.3.1.js"></script>
<script src="/static/plugin/jquery/jquery.cookie.js"></script>
<!--bootstrap-->
<script src="/static/plugin/bootstrap/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="/static/plugin/other/html5shiv.js"></script>
<script src="/static/plugin/other/respond.min.js"></script>
<![endif]-->
<!--layui-->
<script src="/static/plugin/layui-2.4.3/layui.all.js"></script>
<!--ztree-->
<script src="/static/plugin/zTree/js/jquery.ztree.all.js"></script>
<!--common-->
<script src="/static/js/common.js"></script>
<!--jo-->
<script src="/static/plugin/jo/jo.js"></script>
<script src="/static/plugin/jo/jo-adapt.js"></script>
<script src="/static/plugin/jo/jo-page-view.js"></script>
<script src="/static/plugin/jo/jo-page-form.js"></script>
<script src="/static/plugin/jo/jo-listener.js"></script>
<script type="text/javascript">
    layui.laydate.render({
        elem: '#sampleTime' //注册日期控件
    });
    $(function(){
        var jParams = {
            "PKName" : "id",//主键属性名
            "saveAfter" : "toEdit",
            "addUrl" : "/nyd/enterpriseSample/insert",//新增
            "deleteUrl" : "/nyd/enterpriseSample/delete",//删除
            "updateUrl" : "/nyd/enterpriseSample/update",//修改
            "formDataUrl" : "/nyd/enterpriseSample/get",//查询
            //"readonly2Label" : true //只读转文本
        };
        initButton();//初始化按钮
        joForm.initFormPage(jParams);//初始化
    });
    //初始化新增页面回调函数(在初始化按钮前发生)
    joForm.initFormPageOfAdd = function(){
        if(joForm.isAdd){
            $("#divid").hide();
            if(jo.getUrlParam("type")== '1'){
                var html ='<select class="joSelect form-control" name="enterpriseId"><option value='+jo.getUrlParam("enterpriseId")+'>'+jo.getUrlParam("enterprisename")+'</option></select>';
                $("#pro").hide();
                $("#city").hide();
                $("#cou").hide();
                $("#qiye").html(html);
            }else {
                //初始化省市县联动
                initProvinceCityCounty('provinceCode', 'cityCode', 'countyCode');
            }

        }

        $("#pointCode").val(jo.getUrlParam("pointCode"));
        /*$("#enterpriseId").val(jo.getUrlParam("enterpriseId"));*/

    };
    //初始化表单值前处理
    joForm.initFormValueBefore = function(oJson){
        if(joForm.isAdd) {
            //初始化省市县联动
            initProvinceCityCounty('provinceCode', 'cityCode', 'countyCode', joForm.formData.province, joForm.formData.city, joForm.formData.county);
        }else{
            $("#pro").hide();
            $("#city").hide();
            $("#cou").hide();
            $("#lan").hide();
        }


        oJson.sampleTime = jo.formatDate(oJson.sampleTime);
    };
    //初始化表单值后处理
    joForm.initFormValueAfter = function(oJson){

    };
    //新增请求提交前回调函数
    joForm.dealDataAtSaveBefore = function(oJson){

    };
    //修改请求提交前回调函数
    joForm.dealDataAtUpdateBefore = function(oJson){

    };
    /* 关于joForm更多回调函数和配置参数可查看jo-page-form.js */
</script>
</body>
</html>
